function checkValid(entity) {
    if (entity.tel && entity.tel !== "") {
        let reg = /^[1][3,4,5,7,8][0-9]{9}$/;
        if (!reg.test(entity.tel)) {
            layer.msg('请输入正确的手机号', {
                icon: 5,
                time: 2000
            }, function () {});
            return false;
        }
    }
    if (entity.email && entity.email !== "") {
        let reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
        if (!reg.test(entity.email)) {
            //alert("请输入正确的邮箱");
            layer.msg('请输入正确的邮箱', {
                icon: 5,
                time: 2000
            }, function () {});
            return false;
        }
    }
    return true;
}

function logout() {
    axios.get('/logout').then(res => {
        if (res.data.code === '0') {
            window.location = '/end/page/login.html';
        } else {
            alert(res.data.msg);
        }
    })
}
